# -*- coding: utf-8 -*-
# coding:utf-8

from django import template
import wejudge.kernel.problem as ProblemKrl
__author__ = 'lancelrq'

register = template.Library()

@register.filter(name='classify_path')
def show_diff_title(value, arg=None):
    try:
        cids = ProblemKrl.ProblemArchiveQuery.get_classify_path(int(value))
        classifications = ProblemKrl.ProblemArchiveQuery.get_classcifications(cids)
        outstr = ''
        for c in classifications:
            if c.id == int(value):
                continue
            outstr += c.title + " > "
        return outstr
    except:
        return "未知"
